/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityBeans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "flights")
@NamedQueries({
    @NamedQuery(name = "Flights.findAll", query = "SELECT f FROM Flights f"),
    @NamedQuery(name = "Flights.findByNr", query = "SELECT f FROM Flights f WHERE f.nr = :nr"),
    @NamedQuery(name = "Flights.findByFare", query = "SELECT f FROM Flights f WHERE f.fare = :fare"),
    @NamedQuery(name = "Flights.findByDepTime", query = "SELECT f FROM Flights f WHERE f.depTime = :depTime"),
    @NamedQuery(name = "Flights.findByArrTime", query = "SELECT f FROM Flights f WHERE f.arrTime = :arrTime"),
    @NamedQuery(name = "Flights.findByAirline", query = "SELECT f FROM Flights f WHERE f.airline = :airline"),
    @NamedQuery(name = "Flights.findByDepAirport", query = "SELECT f FROM Flights f WHERE f.depAirport = :depAirport"),
    @NamedQuery(name = "Flights.findByArrAirport", query = "SELECT f FROM Flights f WHERE f.arrAirport = :arrAirport")})
public class Flights implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "nr")
    private String nr;
    @Column(name = "fare")
    private Integer fare;
    @Column(name = "depTime")
    @Temporal(TemporalType.TIME)
    private Date depTime;
    @Column(name = "arrTime")
    @Temporal(TemporalType.TIME)
    private Date arrTime;
    @Column(name = "airline")
    private String airline;
    @Column(name = "depAirport")
    private String depAirport;
    @Column(name = "arrAirport")
    private String arrAirport;

    public Flights() {
    }

    public Flights(String nr) {
        this.nr = nr;
    }

    public String getNr() {
        return nr;
    }

    public void setNr(String nr) {
        this.nr = nr;
    }

    public Integer getFare() {
        return fare;
    }

    public void setFare(Integer fare) {
        this.fare = fare;
    }

    public Date getDepTime() {
        return depTime;
    }

    public void setDepTime(Date depTime) {
        this.depTime = depTime;
    }

    public Date getArrTime() {
        return arrTime;
    }

    public void setArrTime(Date arrTime) {
        this.arrTime = arrTime;
    }

    public String getAirline() {
        return airline;
    }

    public void setAirline(String airline) {
        this.airline = airline;
    }

    public String getDepAirport() {
        return depAirport;
    }

    public void setDepAirport(String depAirport) {
        this.depAirport = depAirport;
    }

    public String getArrAirport() {
        return arrAirport;
    }

    public void setArrAirport(String arrAirport) {
        this.arrAirport = arrAirport;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nr != null ? nr.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Flights)) {
            return false;
        }
        Flights other = (Flights) object;
        if ((this.nr == null && other.nr != null) || (this.nr != null && !this.nr.equals(other.nr))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Flights[nr=" + nr + "]";
    }
}
